<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>疫苗管理 - 疫苗预约系统</title>
    <link rel="stylesheet" href="../css/common.css?v=20251119">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body>
    <div class="main-container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-header">
                <i class="fas fa-syringe"></i>
                <h2>疫苗预约系统</h2>
                <p>系统管理员</p>
            </div>
            <nav class="sidebar-menu">
                <a href="home.html" class="menu-item">
                    <i class="fas fa-home"></i>
                    <span>首页</span>
                </a>
                <a href="site.html" class="menu-item">
                    <i class="fas fa-hospital"></i>
                    <span>接种点管理</span>
                </a>
                <a href="staff.html" class="menu-item">
                    <i class="fas fa-user-tie"></i>
                    <span>工作人员管理</span>
                </a>
                <a href="vaccine.html" class="menu-item active">
                    <i class="fas fa-vial"></i>
                    <span>疫苗管理</span>
                </a>
                <a href="statistics.html" class="menu-item">
                    <i class="fas fa-chart-line"></i>
                    <span>数据统计</span>
                </a>
            </nav>
        </div>

        <!-- 主内容区域 -->
        <div class="main-content">
            <!-- 顶部导航栏 -->
            <div class="top-navbar">
                <div class="navbar-left">
                    <h1>疫苗管理</h1>
                </div>
                <div class="navbar-right">
                    <div class="user-info">
                        <div class="user-avatar" id="userAvatar">S</div>
                        <span class="user-name" id="userName">超级管理员</span>
                    </div>
                    <button class="btn-logout" onclick="handleLogout()">
                        <i class="fas fa-sign-out-alt"></i> 退出登录
                    </button>
                </div>
            </div>

            <!-- 内容区域 -->
            <div class="content-area">
                <!-- 页面标题 -->
                <div class="page-header">
                    <h2 class="page-title">疫苗管理</h2>
                    <button class="btn btn-primary" onclick="showAddModal()">
                        <i class="fas fa-plus"></i> 添加疫苗
                    </button>
                </div>

                <!-- 疫苗列表 -->
                <div class="card">
                    <div class="card-header">
                        <h3 class="card-title">疫苗列表</h3>
                    </div>
                    <div class="card-body">
                        <div class="table-container">
                            <table class="table">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>疫苗名称</th>
                                        <th>类型</th>
                                        <th>适用年龄段</th>
                                        <th>生产厂家</th>
                                        <th>生产日期</th>
                                        <th>有效期至</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody id="vaccineTableBody">
                                    <tr>
                                        <td colspan="8" class="text-center">加载中...</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>

                        <!-- 分页 -->
                        <div class="pagination" id="pagination"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 添加/编辑疫苗模态框 -->
    <div class="modal" id="vaccineModal">
        <div class="modal-content" style="max-width: 600px;">
            <div class="modal-header">
                <h3 id="modalTitle">添加疫苗</h3>
                <button class="modal-close" onclick="closeModal()">&times;</button>
            </div>
            <div class="modal-body">
                <form id="vaccineForm">
                    <input type="hidden" id="vaccineId">

                    <div class="form-group">
                        <label for="vaccineName">疫苗名称 <span class="required">*</span></label>
                        <input type="text" id="vaccineName" class="form-control" required maxlength="100">
                    </div>

                    <div class="form-group">
                        <label for="vaccineType">疫苗类型 <span class="required">*</span></label>
                        <select id="vaccineType" class="form-control" required>
                            <option value="">请选择</option>
                            <option value="0">普通疫苗</option>
                            <option value="1">儿童疫苗</option>
                            <option value="2">成人疫苗</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <label for="applicableAgeGroup">适用年龄段 <span class="required">*</span></label>
                        <input type="text" id="applicableAgeGroup" class="form-control" required maxlength="50" placeholder="例如: 18-60岁">
                    </div>

                    <div class="form-group">
                        <label for="manufacturer">生产厂家 <span class="required">*</span></label>
                        <input type="text" id="manufacturer" class="form-control" required maxlength="100">
                    </div>

                    <div class="form-group">
                        <label for="productionDate">生产日期 <span class="required">*</span></label>
                        <input type="date" id="productionDate" class="form-control" required>
                    </div>

                    <div class="form-group">
                        <label for="validityPeriod">有效期至 <span class="required">*</span></label>
                        <input type="date" id="validityPeriod" class="form-control" required>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button class="btn btn-secondary" onclick="closeModal()">取消</button>
                <button class="btn btn-primary" onclick="handleSubmit()">保存</button>
            </div>
        </div>
    </div>

    <script src="../js/common.js"></script>
    <script src="js/vaccine.js"></script>
</body>
</html>


